exports.getCustomModel = function(req,res){

    var bodyParams = req.routeInfo.bodyParams;

    var tableDescData = [];

    var customFieldData = [];

    //获取表结构信息
    function getTableDesc(cb){
        
        R.SEND_HTTP(
            req,
            res,
            {
                url    : CORE_APIConfig.coreAPI.dbGetTableDesc.Request_Api_Url,
                method : 'POST',
                data   : {
                    dbName    : bodyParams.appKey,
                    tableName : bodyParams.tableName
                }
            },
            function (data) { 

                tableDescData = data.result;

                cb();
                
            }
        )

    }

    //筛选出自定义字段
    function screeningCustomField(cb){

        for(var i=0;i<tableDescData.length;i++){

            if(tableDescData[i].COLUMN_NAME.indexOf('_custom') != -1){
                
                customFieldData.push(tableDescData[i]);
            }
        }

        cb();

    }

    F.Serial([
        getTableDesc,
        screeningCustomField
    ],() => {
        RES.successResponse(res,customFieldData);
    })

    


}